<%@page import="com.xxb.entity.CartItem"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String id = request.getParameter("id");
	
	List<CartItem> list = (List<CartItem>)session.getAttribute("shopcar");
	
	int index = -1;
	for(int i = 0;i<list.size();i++) {
		if(list.get(i).getProduct().getId() == Integer.valueOf(id)){
			index = i;
		}
	}
	
	if(index != -1) {
		list.remove(index);
	}
	
	session.setAttribute("shopcar",list);
	response.sendRedirect("cart.jsp");
%>